package edu.nf.controller.room;

import edu.nf.controller.BaseController;
import edu.nf.hotel.roomtype.RoomType;
import edu.nf.hotel.roomtypedao.RoomTypeDAO;
import edu.nf.hotel.roomtypedao.impl.RoomTypeDaoImpl;
import edu.nf.hotel.vo.ResultVO;
import org.nf.web.annotation.Model;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

/**
 * @Data 2023-06-20
 * @Author Lsw
 */
public class AddRoomTypeController extends BaseController {

    @RequestMapping("/addRoomType")
    public View addRoomType(@Model RoomType roomType) {

        RoomTypeDAO roomTypeDAO = new RoomTypeDaoImpl();

        roomTypeDAO.insert(roomType);

        ResultVO resultVO = success(roomTypeDAO);
        resultVO.setCode(200);
        resultVO.setMessage("添加成功");
        return new JsonView(resultVO);

    }

}
